package com.runjian.demo;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * Knife4jApplication
 *
 * @author Admin
 * @Date: 2025-04-17 21:34
 */
@MapperScan({"com.runjian.demo.*.mapper"})
@Slf4j
@SpringBootApplication
public class Knife4jApplication {

    public static void main(String[] args) {
        long n1 = System.currentTimeMillis();
        ConfigurableApplicationContext context = SpringApplication.run(Knife4jApplication.class, args);
        ConfigurableEnvironment environment = context.getEnvironment();
        log.info("GetProperty---Datasource.host:{}", environment.getProperty("spring.datasource.jdbc-url"));
        log.info("GetProperty---Profiles.active:{}", environment.getProperty("spring.profiles.active"));
        log.info("GetProperty---Swagger文档:http://127.0.0.1:{}/doc.html", environment.getProperty("server.port"));
        log.info("服务{}启动成功，共耗时：{} (构建时间:20250428)", environment.getProperty("spring.application.name"), (System.currentTimeMillis() - n1));
    }

}
